Optimal. Leaf size=54 \[ \frac {i a B x}{c}+\frac {a B \log (\cos (e+f x))}{c f}+\frac {a (A-i B)}{c f (i+\tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {3669, 45}
\begin {gather*} \frac {a (A-i B)}{c f (\tan (e+f x)+i)}+\frac {a B \log (\cos (e+f x))}{c f}+\frac {i a B x}{c} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 3669
Rubi steps
\begin {align*} \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{c-i c \tan (e+f x)} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(c-i c x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {-A+i B}{c^2 (i+x)^2}-\frac {B}{c^2 (i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {i a B x}{c}+\frac {a B \log (\cos (e+f x))}{c f}+\frac {a (A-i B)}{c f (i+\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(123\) vs. \(2(54)=108\).
time = 0.84, size = 123, normalized size = 2.28 \begin {gather*} \frac {a (-i \cos (e+f x)+\sin (e+f x)) \left (\cos (e+f x) \left (A-i B-4 B f x+i B \log \left (\cos ^2(e+f x)\right )\right )+2 B \text {ArcTan}(\tan (2 e+f x)) (\cos (e+f x)-i \sin (e+f x))+\left (i A+B+4 i B f x+B \log \left (\cos ^2(e+f x)\right )\right ) \sin (e+f x)\right )}{2 c f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 44, normalized size = 0.81
method | result | size |
derivativedivides | \(\frac {a \left (-B \ln \left (i+\tan \left (f x +e \right )\right )-\frac {i B -A}{i+\tan \left (f x +e \right )}\right )}{f c}\) | \(44\) |
default | \(\frac {a \left (-B \ln \left (i+\tan \left (f x +e \right )\right )-\frac {i B -A}{i+\tan \left (f x +e \right )}\right )}{f c}\) | \(44\) |
risch | \(-\frac {{\mathrm e}^{2 i \left (f x +e \right )} B a}{2 c f}-\frac {i {\mathrm e}^{2 i \left (f x +e \right )} a A}{2 c f}-\frac {2 i a B e}{c f}+\frac {a B \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{c f}\) | \(74\) |
norman | \(\frac {\frac {\left (-i a B +a A \right ) \tan \left (f x +e \right )}{c f}+\frac {i a B x}{c}+\frac {i a B x \left (\tan ^{2}\left (f x +e \right )\right )}{c}-\frac {i a A +a B}{c f}}{1+\tan ^{2}\left (f x +e \right )}-\frac {a B \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 c f}\) | \(102\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.65, size = 45, normalized size = 0.83 \begin {gather*} \frac {{\left (-i \, A - B\right )} a e^{\left (2 i \, f x + 2 i \, e\right )} + 2 \, B a \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{2 \, c f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.19, size = 88, normalized size = 1.63 \begin {gather*} \frac {B a \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{c f} + \begin {cases} \frac {\left (- i A a e^{2 i e} - B a e^{2 i e}\right ) e^{2 i f x}}{2 c f} & \text {for}\: c f \neq 0 \\\frac {x \left (A a e^{2 i e} - i B a e^{2 i e}\right )}{c} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 130 vs. \(2 (50) = 100\).
time = 0.56, size = 130, normalized size = 2.41 \begin {gather*} \frac {\frac {B a \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{c} - \frac {2 \, B a \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}{c} + \frac {B a \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{c} + \frac {3 \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 2 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 8 i \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 3 \, B a}{c {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{2}}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.57, size = 51, normalized size = 0.94 \begin {gather*} \frac {\frac {A\,a}{c}-\frac {B\,a\,1{}\mathrm {i}}{c}}{f\,\left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )}-\frac {B\,a\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )}{c\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________